package com.example.leetdemo.finash;

import java.util.ArrayList;
import java.util.List;

public class Solution1447 {

    public List<String> simplifiedFractions(int n) {
        List<String> result = new ArrayList<>();
        for (int i = 2; i <= n; i++) {
            for (int j = 1; j < i; j++) {
                if (simplified(j, i)) {
                    result.add(j + "/" + i);
                }
            }
        }
        return result;
    }

    private boolean simplified(int x, int y) {
        for (int i = 2; i <= x; i++) {
            if (x % i == 0 && y % i == 0) {
                return false;
            }
        }
        return true;
    }

}
